import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-07-19
 * Time: 22:59
 */
public class Test64 {
    public static int searchInsert(int[] num, int target) {
        int left = 0, right = num.length-1;
        while(left < right) {
            int mid = left + (right-left) / 2;
            if(num[mid] == target) {
                return mid;
            }
            else if(num[mid] < target) {
                left = mid+1;
            } else {
                right = mid;
            }
        }
        int end = num.length;
        if(num[left] < target) {
            return end;
        }
        return left;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] num = new int[n];
        int target = sc.nextInt();
        for(int i = 0; i < n; i++) {
            num[i] = sc.nextInt();
        }
        int ret = searchInsert(num,target);
        System.out.println(ret);
    }
}
